<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue-2.6.10.js"></script>
</head>
<body>
<div id="app">

    <input type="text" v-model="message">
    <hr><br>
    <input type="text" v-model="person.name"><br>
    <input type="text" v-model="person.age">
    <button @click="person.age++">加</button>
    <h2>
        姓名为：{{person.name}}；年龄为：{{person.age}}
    </h2>
</div>
<script type="text/javascript">
    new Vue({
        el: "#app",
        data: {
            message:"长颈鹿",
            person:{"name":"zhansan","age":33}
        },

        watch:{
            message(newValue,oldValue){
                console.log("新值：" + newValue + "；旧值：" + oldValue);
            },
            person:{
                deep: true,
                handler(obj){
                    console.log("name = " + obj.name + "; age=" + obj.age);
                }
            }
        }
    });
</script>
</body>
</html>